473,418 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Dropdown list "onchange" help

I have a "submit" button in a form that creates a record in my Filemaker
database that works as it should. This is the HTML for it:

<INPUT TYPE="SUBMIT" name="-New" VALUE="Add Record">

I have a drop down list on that same form that works fine, but I want it to
perform the same submit action as above once a value is chosen. This is the
HTML for it:

<SELECT NAME='CustNo' SIZE=1 onchange='javascript:document.form1.submit();'>
This performs the submit, but doesn't actually work. Somehow I need to pass
the name="-New" parameter in the javascript for the record to be created in
the database. How would I do that?
Thanks.
Jul 20 '05 #1
2 27359
md*****@yahoo.com (Mark Durgee) writes:
I have a "submit" button in a form that creates a record in my Filemaker
database that works as it should. This is the HTML for it:

<INPUT TYPE="SUBMIT" name="-New" VALUE="Add Record">
Seems correct. You are sure the server understands the minus in front
of New correctly?
I have a drop down list on that same form that works fine, but I want it to
perform the same submit action as above once a value is chosen.
That is a bad idea, since it prevents people from navigating using the
keyboard. They will only be able to hit the first option.
This is the HTML for it:

<SELECT NAME='CustNo' SIZE=1 onchange='javascript:document.form1.submit();'>
You don't need the "javascript:" (unless you are writing for IE and
having some other language as default script language for the page -
all other browsers just parse it as a Javascript label).

Since you are already in the form, you can just write:
onchange="this.form.submit();"
That would be equivalent to the onchange handler you had.
This performs the submit, but doesn't actually work. Somehow I need to pass
the name="-New" parameter in the javascript for the record to be created in
the database. How would I do that?


You could probably go through a lot of hoops to get add the parameter,
but I think the easiest way is:
onchange="this.form.elements['-New'].click();"

I still want you to reconsider submitting in the select onchange
property.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
> > <INPUT TYPE="SUBMIT" name="-New" VALUE="Add Record">

Seems correct. You are sure the server understands the minus in front
of New correctly?
That's the button that works correctly.
I have a drop down list on that same form that works fine, but I want it to perform the same submit action as above once a value is chosen.


That is a bad idea, since it prevents people from navigating using the
keyboard. They will only be able to hit the first option.


I didn't really think of that until you mentioned it. However, these aren't
power users and my own observation with people in this office is that many
prefer clicking with the mouse - even though it's so inefficient.
You could probably go through a lot of hoops to get add the parameter,
but I think the easiest way is:
onchange="this.form.elements['-New'].click();"
I got it to work by adding <INPUT TYPE="HIDDEN" name="-New" VALUE="Add
Record"> at the top of the form and using onchange submit()
I still want you to reconsider submitting in the select onchange
property.


I will definitely will take it into consideration. I'll probably build a
page with a submit button and another that does it automatically and see
what the users like better.

Thanks for your help!

Mark
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ron Brennan | last post by:
I've spent all morning on this and now think there is a (slight?) possiblity that onchange doesn't work for input type="file". Can anybody shed any light on this. The onblur fires just fine. The...
1
by: John Pastrovick | last post by:
Is there a way to load an image locally (in the client) when a selection of a file is made using input type=file. The purpose is to allow selection of a file and put the image in the browser...
3
by: Norm via DotNetMonster.com | last post by:
I have an onchange event which fires when the content of an HTML textbox changes. My problem is that when I try to compare the content of this textbox with another HTML textbox using an if...
1
by: julian.tklim | last post by:
Hi, I've got an input box with popup calendar (date picker) all generated using javascipt. Once a date is selected from the datepicker window, the date value is populated back to the input...
6
by: jwarnock | last post by:
When a text field is terminated by a "tab" or change of focus, the browsers behave the same (IE, FireFox, Safari, Netscape). When the text field is terminated by a "return", then "onchange" is...
7
by: slekshmipriya | last post by:
Hai friends.I have a pblm with my drop down list onchange event.The pblm is as follow I have a drop drown list with items 1,2 ,3 etc. On selecting an item from the drop down list i want to...
4
by: mbiasetti | last post by:
Hello, quick question (hopefully): I have a script that manipulates two "Select" elements. My onload calls a function that sets onchange for each "Select": ...
7
by: TriAdmin | last post by:
I am working with a system that allow me to add custom fields but I can not add OnChange() language to the custom fields. So I want to have a function in the header that recognizes when fieldx is...
14
by: white lightning | last post by:
How to have <select onchange="this.form.submit()"and also a Submit button on one form? I have something like this: <form action="<?php $_SERVER; ?>" method="post"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.